//
//  SJCustomLayout.h
//  WSL
//
//  Created by CJ on 2017/10/8.
//  Copyright © 2017年 sanjuetech. All rights reserved.
//

#import <UIKit/UIKit.h>

UIKIT_EXTERN NSString *const SJ_UICollectionElementKindSectionHeader;
UIKIT_EXTERN NSString *const SJ_UICollectionElementKindSectionFooter;

@class SJCustomLayout;

@protocol SJCustomLayoutDelegate <NSObject>

@required
// 代理取cell 的 frame
- (CGRect)collectionView:(UICollectionView *)collectionView layout:(SJCustomLayout *)layout frameOfItemAtIndexPath:(NSIndexPath *)indexPath;

@optional
// bottomMargin
- (CGFloat)bottomMarginInCollectionView:(UICollectionView *)collectionView layout:(SJCustomLayout *)layout;

- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(SJCustomLayout *)layout heightForHeaderInSection:(NSInteger)section;

@end

@interface SJCustomLayout : UICollectionViewLayout

@property(nonatomic, weak) id<SJCustomLayoutDelegate> delegate;

@end
